<extend name="Public/common"/>
<block name="othercss">
<style type="text/css">
.gwcsum input[type="checkbox"]{appearance: none; -webkit-appearance: none;outline: none;display:none}
.gwcsum label{width:20px;height:20px;cursor:pointer; vertical-align:bottom}
.gwcsum label input[type="checkbox"] + span{width:20px;height:20px;display:inline-block;background:url(__PUBLIC__/phone/images/checkbox_01.gif)  no-repeat;background-position:0 0;}
.gwcsum label input[type="checkbox"]:checked + span{background-position:0 -21px}
</style>
 <script type="text/javascript">
 var url_cart_num = "{:U('Cart/edit_num')}";
 var url_cart_del = "{:U('Cart/del')}";
 var url_cart_delsel = "{:U('Cart/delsel')}";
 var url_cart_clear = "{:U('Cart/clear')}";
 var url_cart_total = "{:U('Cart/total')}";
 var url_check_store_num = "{:U('Cart/check_store_num')}";
 var url_check = "{:U('Check/index')}";
   var url_add_fav = "{:U('Goods/add_fav')}";//商品收藏地址  
</script>
<script type="text/javascript" src="{$theme_path}/js/cart.js"></script> 
</block>
<block name="body">
<div class="main">
    <div class="gwcsum box">
        <div class="gwc1 clearfix">
            <div class="right" style="display:none">
                已选商品（不含运费）<span style="color: #dd2727;">￥0.00</span><a class="jiesuan">结算</a>
            </div>
            <ul class="left">
                <li class="on">
                    <a>全部商品&nbsp;{$cart_count}</a>
                </li>
          
            </ul>
        </div>
         <form name="form_mycart" id="form_mycart" method="post" >
        <div class="gwc2">
            <ul class="clearfix">
                <li class="gt1">
           
                </li>
                <li class="gt2">商品信息</li>
                <li class="gt3">单价（元）</li>
                <li class="gt4">数量</li>
                <li class="gt5">金额（元）</li>
                <li class="gt6">操作</li>
            </ul>
            <table>
               <foreach name="cart_list" item="cart_item">
                <tr  id="tr_cart_{$cart_item.cart_id}">
                    <td class="gt1">
                     <label><input type="checkbox" name="sel[]" onclick="cart_total();" value="{$cart_item.cart_id}" class="cart_check" checked="checked"><span></span></label>
                    </td>
                    <td class="gt2">
                        <a class="clearfix" href="{:U('Goods/index',array('id'=>$cart_item['goods_id']))}" target="_blank">
                            <div class="lans">{$cart_item.goods_name}<br />商品编号：{$cart_item.goods_sn} <br /><span class="spec">{$cart_item.spec_array}</span></div>
                            <div class="imgs"><img src="__ROOT__{$cart_item.picture}" width="80" height="80"/> </div>
                        </a>
                    </td>
                    <td class="gt3">
                        <span class="hui">{$cart_item.price_market}</span>
                        <span class="hong">{$cart_item.price}</span>
                    </td>
                    <td class="gt4">
                        <div class="number-add clearfix">
                            <i id="btn_jian_num" onclick="cart_jian({$cart_item.cart_id})" value="-">-</i>
                            <input type="text"  id="num_{$cart_item.cart_id}" name="num_{$cart_item.cart_id}" value="{$cart_item.num}" onblur="cart_num({$cart_item.cart_id})" class="num"/>
                           
                            <i onclick="cart_jia({$cart_item.cart_id})">+</i>
                        </div>
                                      <input type="hidden" id="old_num_{$cart_item.cart_id}" value="{$cart_item.num}"  />
                                    <input type="hidden" id="price_{$cart_item.cart_id}" value="{$cart_item.price}"  />
                                    <input type="hidden" id="store_num_{$cart_item.cart_id}" value="{$cart_item.store_num}" /><div id="store_num_msg_{$cart_item.cart_id}">
                                    <if condition="$cart_item['store_num'] elt 0">
                                        <font color=red>无货</font>
                                        <elseif condition="$cart_item['store_num'] lt $cart_item['num']" />
                                        <font color=red>仅剩{$cart_item.store_num}</font>
                                        <elseif condition="$cart_item['store_num'] elt 5" />
                                        <font color=gray>仅剩{$cart_item.store_num}</font>
                                    </if>
                                </div>
                    </td>
                    <td class="gt5">
                        <span class="hong" id="sub_total_{$cart_item.cart_id}">{$cart_item.total}</span>
                    </td>
                    <td class="gt6">
                        <a onclick="add_fav({$cart_item['goods_id']},{$cart_item['item_id']})">加入收藏夹</a>
                        <a href="javascript:void(0)" class="del" onclick="cart_del({$cart_item.cart_id})">删除</a>
                    </td>
                </tr>
                 </foreach>
            
            </table>
            
        </div>
        <div class="gwc3 clearfix">
            <div class="right">
                <a>已选商品<span class="number" id="select_cart_num">{$cart_count}</span>件</a>
                <a>合计（不含运费）:<span class="number">￥<span id="cart_total">{$cart_total|tofixed=2}</span></span></a>
                <a class="jiesuans" href="javascript:void(0)" onclick="checkout()">结算</a>
            </div>
            <div style="padding-left:10px; display:none">
                   <label><input type="checkbox" name="selall" id="selall" value="1" onclick="sel_all(this.form)" checked="checked" ><span></span></label>全选
               
            </div>
        </div>
          </form>
    </div>
    <div class="gwcsum box">
        <div class="gwc1 clearfix box">
            <ul class="left">
            
                <li class="on">
                    <a>最近浏览过的</a>
                </li>
       
            </ul>
        </div>
        <!--pro-lists-->
        <div class="right  ris">
            <div class="pro-lists">
                <ul class="clearfix">
                 <foreach name="history_list" item="history_item">
                    <li>
                        <a class="each-item" href="{:U('Goods/index',array('id'=>$history_item['goods_id']))}" target="_blank">
                            <div class="imgs picture">
                                <img src="__ROOT__{$history_item.picture}" width="220" height="220"/>
                                <div class="searchs">查看商品</div>
                            </div>
                            <div class="price clearfix">
                                <div class="t1">￥ {$history_item.price_market}</div>
                                <div class="t2">￥ <span class="big">{$history_item.price}</span></div>
                            </div>
                            <div class="twos">{$history_item.goods_name}
                            </div>
                        </a>
                    </li>
                   </foreach>
                </ul>
            </div>
        </div>
    </div>
</div>
</block>
<block name="otherjs">
<script>
    $(function () {
        $('.jssum tr').hover(function () {
            $(this).children('td').addClass('bg');
        }, function () {
            $(this).children('td').removeClass('bg');
        })
        $('#tanchu').click(function(){
            $('.bg_heise').stop(true,true).fadeIn();
        })
        $('.bg_heise img').click(function(){
            $('.bg_heise').stop(true,true).fadeOut();
        })
    })
</script>

</block>

